﻿using System.Security.Cryptography;
using System.Text;

namespace Assets.Scripts.Tool
{
    public class Md5Encript 
    {
        public static string GetMd5HashStr(string str)
        {
            string pwd = string.Empty;
            MD5 md5 = MD5.Create();
            byte[] s = md5.ComputeHash(Encoding.UTF8.GetBytes(str));
            for (int i = 0; i < s.Length; i++)
            {
                string lowerS = s[i].ToString("x");
                if (lowerS.Length == 1)
                    lowerS = "0" + lowerS;
                pwd += lowerS;
            }
            return pwd;
        }
    }
}